#ifndef ADVANCEDLABEL_H
#define ADVANCEDLABEL_H

#include "../utils_global.h"
#include <QLabel>
class QTextDocument;
class QTextCursor;
class QTextControl;
namespace TWUtils{
namespace UI{
	class TWUTILS_EXPORT AdvancedLabel : public QLabel
	{
		public:
			explicit AdvancedLabel(QWidget *parent = 0);
			void setText(const QString& text);

			static void setDefaultLinkColor(const QColor& c){ defaultLinkColor = c; }
		protected:
			void mouseMoveEvent(QMouseEvent* e);
			void leaveEvent(QEvent*);
		private:
			void revertAllFormat(QTextCursor&);

			bool isHoveringLink;
			static QColor defaultLinkColor;
		private:
			QLabelPrivate* pimpl;
	};
}
}

#endif // ADVANCEDLABEL_H
